Skip to content

Keep fold when unwrapping a datetime or time - #626

Merged
frostming merged 1 commit into
python-poetry:masterfrom
SashaMIT:unwrap-fold
Oct 12, 2026
Merged

frostming merged 1 commit into
python-poetry:masterfrom
SashaMIT:unwrap-fold

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

DateTime.unwrap() and Time.unwrap() rebuilt the stdlib value without fold. A folded 01:30 then converted an hour early (timestamp() was 3600 seconds off). == still passed, because datetime equality ignores fold.

Test plan

  • pytest tests/test_items.py::test_unwrap_keeps_fold fails on master (fold is 0) and passes with this change
  • pytest tests/test_items.py (101 passed)

Agent Drafting Metadata

  • Agent: Cursor
  • Model: Grok 4.7
  • Notes:

unwrap() rebuilt the stdlib value without fold, so a folded local time converted an hour off.
@frostming
frostming merged commit 89cdcc7 into python-poetry:master Oct 12, 2026
25 checks passed
@SashaMIT

Copy link
Copy Markdown
Author

Thanks for merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants